#include <stdio.h>
#include <signal.h>
#include <unistd.h>

int main(int argc,char** argv)
{
  sigset_t set,old_set;
  sigemptyset(&set);
  sigaddset(&set,SIGINT);
  sigprocmask(SIG_BLOCK,&set,&old_set);
  
  int i = 0;
  while(1)
  {
    printf("hello world,%d\n",i);
    usleep(2000);
    if(i == 1000)
    {
      break;
    }
    i++;
  }
  
  sigprocmask(SIG_UNBLOCK,&set,&old_set);
  while(1)
  {
    printf("ni hao\n");
    sleep(1000);
  }

  return 0;
}
